package com.lwc.cfdns.pojo.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.lwc.cfdns.pojo.BaseEntity;

import java.io.Serializable;
import java.util.Date;

import com.lwc.cfdns.pojo.dto.ValidGroup;
import lombok.Data;

import javax.validation.constraints.NotNull;

/**
 * 后台组合数据详情表
 *
 * @TableName cfdns_system_group_data
 */
// json 字段处理https://baomidou.com/pages/fd41d8/
@TableName(value = "cfdns_system_group_data", autoResultMap = true)
@Data
public class SystemGroupData extends BaseEntity implements Serializable {
    /**
     * 组合数据ID
     */
    @TableId(type = IdType.AUTO)
    @NotNull(message = "ID不能为空", groups = {ValidGroup.Update.class})
    private Long id;

    /**
     * 对应的数据组id
     */
    @NotNull(message = "GroupID不能为空", groups = {ValidGroup.Create.class, ValidGroup.Update.class})
    private Long groupId;

    /**
     * 数据组对应的数据值（json数据）
     */
    @NotNull(message = "组合数据值不能为空", groups = {ValidGroup.Create.class, ValidGroup.Update.class})
    @TableField(typeHandler = JacksonTypeHandler.class)
    private Object groupValues;

    /**
     * 显示顺序
     */
    private Integer sort = 0;

    /**
     * 备注
     */
    private String remark;

    /**
     * 状态 0正常 1禁用
     */
    private String status = "0";

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}